package com.infore.dataReceiving.enums;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 日志与状态量枚举
 * @author Cold
 *
 */
public enum LogStatusEnum {
	ONLINE_MONITOR_LOG("ONLINE_MONITOR_LOG", Arrays.asList("i11001")), // 在线监测仪器日志
	ONLINE_MONITOR_STATUS("ONLINE_MONITOR_STATUS", Arrays.asList("i12001", "i12002", "i12003", "i12031")), // 在线监测仪器状态
	ONLINE_MONITOR_PARAM("ONLINE_MONITOR_PARAM", Arrays.asList("i13001", "i13002", "i13003", "i13004", "i13005",
			"i13006", "i13007", "i13008", "i13009", "i13010", "i13011", "i13012", "i13013")), // 在线监测仪器参数
	DATA_GATHER_LOG("DATA_GATHER_LOG", Arrays.asList("i21001")), // 数据采集传输仪日志
	DATA_GATHER_STATUS("DATA_GATHER_STATUS", Arrays.asList("i22001", "i22002", "i22003")); // 数据采集传输仪状态

	private LogStatusEnum(String msg, List<String> codes) {
		this.msg = msg;
		this.codes = codes;
	}

	private String msg;
	private List<String> codes;

	public String getMsg() {
		return msg;
	}
	public List<String> getCodes() {
		return codes;
	}
	
	public static List<String> getCodes(String msg) {
    	for (LogStatusEnum ls : LogStatusEnum.values()) {
            if (ls.getMsg().equals(msg)) {
                return ls.getCodes();
            }
        }
    	return new ArrayList<String>();
    }
	
}
